//
//  DCAuthViewModel.m
//  Demo
//
//  Created by zhaolin on 2023/1/12.
//

#import "DCAuthViewModel.h"
#import "DCAuthPhotoController.h"
#import "DCAuthBasicInfoController.h"
#import "DCAuthPersonalInfoController.h"
#import "DCAuthContactsController.h"
#import "DCAuthIdentifyController.h"
#import "DCAuthBankCardController.h"

@interface DCAuthViewModel ()


@end
@implementation DCAuthViewModel


- (void)getNextStep{
    [DCHttpRequest DCAuthNextStepCompleteBlock:^(NSURLSessionDataTask * _Nonnull operation, DCResponseData * _Nonnull responseObject) {
        if (responseObject.code == 200) {
            DLog(@"%@",responseObject.data);
            if ([responseObject.data isKindOfClass:[NSString class]]) {
                NSString *step = (NSString *)responseObject.data;
                if ([step isEqualToString:@"BASE_INFO"]) {
                    //认证-基础信息
//                    DCAuthBasicInfoController *basicInfoVC = [DCAuthBasicInfoController new];
//                    [self.navigationController pushViewController:basicInfoVC animated:YES];
                } else if ([step isEqualToString:@"IDENTITY_INFO"]){
                    //认证-KTP
//                    DCAuthIdentifyController *idVC = [DCAuthIdentifyController new];
//                    [self.navigationController pushViewController:idVC animated:YES];
                } else if ([step isEqualToString:@"LIVENESS_INFO"]){
                    //认证-活体
//                    DCAuthPhotoController *photoVC = [DCAuthPhotoController new];
//                    [self.navigationController pushViewController:photoVC animated:YES];
                } else if ([step isEqualToString:@"PERSONAL_INFO"]){
                    //认证-个人信息
//                    DCAuthPersonalInfoController *personalVC = [DCAuthPersonalInfoController new];
//                    [self.navigationController pushViewController:personalVC animated:YES];
                } else if ([step isEqualToString:@"CONTACT_INFO"]){
                    //认证-联系人
//                    DCAuthContactsController *contactsVC = [DCAuthContactsController new];
//                    [self.navigationController pushViewController:contactsVC animated:YES];
                } else if ([step isEqualToString:@"BANK_INFO"]){
                    //认证-银行卡
//                    DCAuthBankCardController *bankVC = [DCAuthBankCardController new];
//                    [self.navigationController pushViewController:bankVC animated:YES];
                } else if([step isEqualToString:@"100"]){
                    //认证完成
                    
                }
            } else {
                
            }
        } else {
            [DCDCToast toastText:responseObject.message];
        }
    }];
}

- (void)saveInfo2:(NSString *)step data:(NSString *)data{
    [DCHttpRequest DCAuthSaveInfo2:step data:data completeBlock:^(NSURLSessionDataTask * _Nonnull operation, DCResponseData * _Nonnull responseObject) {
        DLog(@"DCAuthSaveInfo2 :%ld,\n%@,\n%@,\n%@",responseObject.code,responseObject.message, responseObject.data,responseObject.error);
    }];
}
@end
